<div class="layui-col-md8">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">快捷方式</div>
                <div class="layui-card-body">
                    <div class="layui-carousel layadmin-carousel layadmin-shortcut">
                        <div >
                            <ul class="layui-row layui-col-space10">
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['extension/index']); ?>">
                                        <i class="layui-icon layui-icon-console"></i>
                                        <cite>分机</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['trunk/index']); ?>">
                                        <i class="layui-icon layui-icon-chart"></i>
                                        <cite>中继</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['routing/index']); ?>">
                                        <i class="layui-icon layui-icon-template-1"></i>
                                        <cite>呼出路由</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['queue/index']); ?>">
                                        <i class="layui-icon layui-icon-chat"></i>
                                        <cite>队列</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['campaign/index']); ?>">
                                        <i class="layui-icon layui-icon-find-fill"></i>
                                        <cite>批量呼出</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['form/index']); ?>">
                                        <i class="layui-icon layui-icon-survey"></i>
                                        <cite>客户表单</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a lay-href="<?php echo \yii\helpers\Url::to(['user/index']); ?>">
                                        <i class="layui-icon layui-icon-user"></i>
                                        <cite>用户</cite>
                                    </a>
                                </li>
                                <li class="layui-col-xs3">
                                    <a>
                                        <i class="layui-icon layui-icon-set"></i>
                                        <cite>设置</cite>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">PBX配置</div>
                <div class="layui-card-body">
                    <div class="layui-carousel layadmin-carousel layadmin-backlog">
                        <div>
                            <ul class="layui-row layui-col-space10">
                                <li class="layui-col-xs6">
                                    <a  class="layadmin-backlog-body">
                                        <h3>分机数量</h3>
                                        <p><cite><?php echo $count_exten; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs6">
                                    <a  class="layadmin-backlog-body">
                                        <h3>中继数量</h3>
                                        <p><cite><?php echo $count_trunk; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs6">
                                    <a  class="layadmin-backlog-body">
                                        <h3>队列数量</h3>
                                        <p><cite><?php echo $count_queue; ?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs6">
                                    <a  class="layadmin-backlog-body">
                                        <h3>批量呼出任务数</h3>
                                        <p><cite><?php echo $count_campaign; ?></cite></p>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">数据概览</div>
                <div class="layui-card-body">
                    <div id="project-chart" style="width: 100%;height: 335px"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-col-md4">
    <div class="layui-card">
        <div class="layui-card-header">版本信息</div>
        <div class="layui-card-body layui-text">
            <table class="layui-table">
                <colgroup>
                    <col width="100"><col>
                </colgroup>
                <tbody>
                <tr>
                    <td>当前版本</td>
                    <td>v1.0.0</td>
                </tr>
                <tr>
                    <td>基于系统</td>
                    <td>ISSABEL4.0+YII2.0.16+LayuiAdmin</td>
                </tr>
                <tr>
                    <td>主要特色</td>
                    <td>外呼功能 / 批量呼出 / 通话记录 / 客户CRM</td>
                </tr>
                <tr>
                    <td>获取渠道</td>
                    <td style="padding-bottom: 0;">
                        <div class="layui-btn-container">
                            <a href="javascript:;" onclick="layer.tips('请联系作者', this, {tips: 1});" class="layui-btn layui-btn-danger">获取授权</a>
                            <a href="uploadfile/client.zip" class="layui-btn">客户端下载</a>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <?php foreach ($campaign as $c){ ?>
    <div class="layui-card">
        <div class="layui-card-header">外呼任务：<?php echo $c['name']; ?></div>
        <div class="layui-card-body layadmin-takerates">
            <div class="layui-progress" lay-showPercent="yes">
                <h3>呼叫进度（总数：<?php echo $c['total']; ?>）</h3>
                <div class="layui-progress-bar layui-bg-orange" lay-percent="<?php echo $c['progress']; ?>"></div>
            </div>
            <div class="layui-progress" lay-showPercent="yes">
                <h3>接通率（接通数：<?php echo $c['abandoned']; ?>）</h3>
                <div class="layui-progress-bar layui-bg-green" lay-percent="<?php echo $c['percent']; ?>"></div>
            </div>
        </div>
    </div>
    <?php } ?>
</div>

<?php
$js = <<<JS
    layui.config({
        version: '1535898708509' //为了更新 js 缓存，可忽略
    }).extend({
        echarts: 'lib/extend/echarts' ,
        echartsTheme: 'lib/extend/echartsTheme' ,
    }).use(['form','element','table', 'layer','echarts','echartsTheme'],function() {
        var form = layui.form;  
        var element = layui.element;  
        var table = layui.table;  
        var layer = layui.layer;  
        var echartsTheme = layui.echartsTheme;  
        var myechart = echarts.init(document.getElementById('project-chart'),echartsTheme);
        myechart.setOption({
            title: {text: "最近一周新增的项目数量", x: "center", textStyle: {fontSize: 14}},
            tooltip: {trigger: "axis", formatter: "{b}<br>新增：{c}"},
            xAxis: [{type: "category", data: [{$line_data_x}]}],
            yAxis: [{type: "value"}],
            series: [{type: "line", data: [{$line_data_y}]}]
        });
        window.onresize = myechart.resize;
    });
JS;
$this->registerJs($js);
